package com.chat.api.web.dao;


import com.chat.api.common.BaseRepo;
import com.chat.api.web.po.LikeBean;
import com.chat.api.web.po.RemarkBean;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface LikeRepo extends BaseRepo<LikeBean,Long> {

    @Query(value = "select count(*) from like_blog where blog_id = ?1 and is_like = 1",nativeQuery = true)
    Integer findCountByBlogId(Long blogId);

    @Query(value = "select * from like_blog where user_id = ?1 and blog_id =?2",nativeQuery = true)
    LikeBean findLike(Long userIdL, Long blogId);
}
